package ca.concordia.comp6231.test;

import java.io.IOException;

import ca.concordia.comp6231.client.OfficerClientCORBA;

public class OfficerClientThread extends Thread {

	String[] args;
	String stationName;
	String action;

	public OfficerClientThread(String[] args, String stationName, String action){
		this.args = args;
		this.stationName = stationName;
		this.action = action;
	}
	
	@Override
	public void run(){
		try {
			OfficerClientCORBA client = new OfficerClientCORBA(args, false, stationName);
			
			try{
				if(action.equals("edit")){
					client.editCRecord("Test,CR10000,Solved");
				}else if(action.equals("transfer")){
					client.transferRecord("CR10000,SPVM");
				}
			}catch(Exception e){
				System.out.println("Error in client" + stationName);
				//e.printStackTrace();
			}
			
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

}
